package com.wu.client.controller;

import com.wu.client.service.ArtistService;
import com.wu.client.vo.req.artist.ArtistReq;
import com.wu.client.vo.res.PageResp;
import com.wu.client.vo.res.artist.ArtistBaseResp;
import com.wu.client.vo.res.artist.ArtistResp;
import com.wu.common.convertion.result.Result;
import com.wu.common.convertion.result.Results;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author Cousin
 * @date 2025/3/16
 * @Description
 */
@RestController
@RequestMapping("artists")
@RequiredArgsConstructor
public class ArtistController {
    private final ArtistService artistService;
    @GetMapping
    public Result<PageResp<ArtistBaseResp>> getArtists(ArtistReq req) {
        return Results.success(artistService.getArtists(req));
    }

    @GetMapping("/{id}")
    public Result<ArtistResp> getArtistDetail(@PathVariable Long id, @RequestParam(required = false) Long userId){
        return Results.success(artistService.getArtisById(id,userId));
    }


}
